﻿using System.Data.SQLite;

namespace RobosimAPI.Class
{
	public static class Config
	{
		/*
		CREATE TABLE config (
		key   TEXT,
		value TEXT
		);
		*/
		public static Dictionary<string, string> data = new Dictionary<string, string>();
		public static void GetConfig()
		{
			data.Clear();
			using (var conn = new SQLiteConnection(Account.DB_CONNECTION_STRING))
			{
				conn.Open();
				using (var cmd = new SQLiteCommand("SELECT * FROM config", conn))
				{
					using (var reader = cmd.ExecuteReader())
					{
						while (reader.Read())
						{
							data.Add(reader["key"].ToString(), reader["value"].ToString());
						}
					}
				}
				conn.Close();
			}
		}
	}
}
